from .import bp_product_a
from db_connect import ConnMysqlSlave
from db_connect import ConnMysql
import aiomysql
from .methods import Product
from sanic import response

@bp_product_a.route('/product_', methods=['POST'])
async def add_product_info(request):

    form_info = request.form

    product_name = form_info.get('product_name')
    product_price = form_info.get('product_price')
    product_image = form_info.get('product_image')

    result = await Product(product_name, product_price, product_image).result()

    return response.json(result)